<?php
/**
 *
 * PHP versions 4 and 5
 *
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 * Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
 * @link          http://cakephp.org CakePHP(tm) Project
 * @package       cake
 * @subpackage    cake.cake.libs.view.templates.layouts
 * @since         CakePHP(tm) v 0.10.0.1076
 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 */
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <?php echo $this->Html->charset(); ?>
  <title>
    <?php __('Centro de Idiomas Unillanos'); ?>
    <?php echo $title_for_layout; ?>
  </title>
  <?php
    echo $this->Html->meta('icon');
	echo $this->Html->css('bootstrap');
	echo $this->Html->css('style');
    echo $this->Html->css('ciu');
	
    echo $this->Html->script(array(
            'jquery/jquery.min',
            'jquery/jquery.hoverIntent.minified',
            'jquery/superfish',
            'jquery/supersubs',
            'jquery/jquery.treeview',
            'jquery/jquery.hotkeys',
            'jquery/jquery.cookie',
            'prettyphoto/js/jquery.prettyPhoto',
            'menu',
        ));
    echo $scripts_for_layout;
  ?>
</head>
    <?php
	  //obtener los datos del usuario conectado.
      App::import('Component', 'Session');
      $mySession = new SessionComponent();
      $userInfo = $mySession->read('Auth.Ciuuser');
      $username=$userInfo['username'];
      $firstnames=$userInfo['first_names'];
    ?>
<body>
  <div class="fluxheader">
  <div class="container">
    <div id="header">
		<div class="row"> <!-- nav site top -->
					<div class="span12">
						<nav class="sitejump pull-right">
							<ul>
								<?php if(isset($username)){ ?>
                                                                          <li><a href="/ciu/ciuusers/home">Inicio</a></li>
                                                                 <?php } ?>
								
                                                                <?php if($firstnames !=""){ 	
                                                                                switch( $userInfo['ciuusertype_id'] ){ 
                                                                                        case 1:
                                                                                                ?><li><?php echo "<a href='/ciu/ciuusers/viewinfo'>".$firstnames ."</a>"; ?> </li>
                                                                                                  <li><a href="/ciu/ciuusers/logout">Salir</a></li>
                                                                                                <?php
                                                                                                break;
                                                                                        case 2:
                                                                                                ?><li><?php echo "<a href='ciu/ciuusers/viewinfo'>".$firstnames ."</a>"; ?> </li> 
                                                                                                  <li><a href="/ciu/ciuusers/logout">Salir</a></li>
                                                                                                <?php
                                                                                                break;
                                                                                        case 3:
                                                                                                ?><li><?php echo "<a href='/ciu/ciuusers/changepass'>".$firstnames ."</a>"; ?> </li>
                                                                                                 <li><a href="/ciu/ciuusers/logout">Salir</a></li>
                                                                                                 <?php
                                                                                                break;
                                                                                        default:
                                                                                                echo "";  
                                                                                }
                                                                      }
                                                                else{ ?>
                                                                <li><a href="/ciu/ciuusers/login">Ingresar</a></li>
								<?php } ?>
							</ul>
						</nav>
					</div> <!-- end 12 -->
				</div> <!-- end row nav site top -->
				<div class="row banner">
                                    <center>
                                        <?php echo $this->Html->image('unillanosbanner.png'); ?>
                                    </center>
				</div> <!--end row banner -->
			</div>
	
    <div class="clearfix">&nbsp;</div> <!-- salto -->
	
	<script type="text/javascript">
	    function showAlert( msg ) {
			var stripped= msg.replace(/(<([^>]+)>)/ig,"");
			if(stripped!=""){
				alert(stripped);
			}
		}
	</script>
	
	
	<!-- contenido de la pagina -->
	<div class="container contentindex" >
			<div class="fluxappcontent">
				<div class="container" >	
						<?php
							echo $content_for_layout;
						?>
				</div><!-- end container -->
			</div> <!-- end fluxappcontent -->
	</div> <!--end contentindex-->
	
	
	<!-- footer -->
	
	
	
  </div>
  </div>  
  <div class="clearfix">&nbsp;</div> <!-- salto -->
	
	
	<div class="fluxfooter">
		<div class="container">				
			<div id="footerciu">
			  <?php echo $this->Html->link(
				  $this->Html->image('cake.power.gif', array('alt'=> __('CakePHP: the rapid development php framework', true), 'border' => '0')),
				  'http://www.cakephp.org/',
				  array('target' => '_blank', 'escape' => false)
				);
			  ?>
			</div>
		</div>
	</div>
  
    <!--
	<div class="fluxfooter">
			<div class="container">
			<footer>
				
				<div id="drms">    
				<p class="copy"><?php echo "CIU" ?> 2014 © derechos reservados - Unillanos</p>
				</div> 
				
			</footer>
			</div> 
	</div> 
	-->
		
	
    <?php //echo "<script>showAlert('" .$this->Session->flash() ."'); </script>";  ?> <!-- TODO alert -->
    	

</body>
</html>